package com.uzai.console.entity.es;

import com.uzai.common.enums.MessageTypeEnum;
import com.uzai.common.utils.EsIndexName;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.List;

/**
 * @Auther: jianghan
 * @Date: 2022/1/16 17:08
 * @Description:
 */
@Document(indexName = EsIndexName.GROUP_SEND_MSG, shards = 3, replicas = 2)
public class EsGroupSendMsg {
    private static final long serialVersionUID = -1025777426280742479L;

    //id=childJobId_deviceId_bizUserId
    @Id
    @Field(type = FieldType.Keyword)
    private String id;
    /**
     * 主任务id
     */
    @Field(type = FieldType.Long)
    private Long parentJobId;
    /**
     * 子任务id
     */
    @Field(type = FieldType.Long)
    private Long childJobId;
    /**
     * 消息
     */
    @Field(type = FieldType.Text)
    private String msg;
    /**
     * 运营商id
     */
    @Field(type = FieldType.Long)
    private Long merId;
    /**
     * 设备唯一id
     */
    @Field(type = FieldType.Long)
    private Long deviceUniqueId;
    /**
     * 设备id
     */
    @Field(type = FieldType.Keyword)
    private String deviceId;
    /**
     * 设备类型
     */
    @Field(type = FieldType.Integer)
    private Integer deviceType;
    /**
     * 消息类型
     * @see MessageTypeEnum
     */

    @Field(type = FieldType.Integer)
    private Integer msgType;
    /**
     * wxid
     */
    @Field(type = FieldType.Keyword)
    private String bizUserId;
    /**
     * 昵称
     */
    @Field(type = FieldType.Text)
    private String nickName;
    /**
     * 延迟时间
     */
    @Field(type = FieldType.Integer)
    private int delay;

    @Field(type = FieldType.Integer)
    private int retry;

    /**
     * 标签
     */

    @Field(type = FieldType.Text)
    private String label;

    /**
     * 备注
     */
    @Field(type = FieldType.Text)
    private String remark;

    @Field(type = FieldType.Long)
    private Long userId;

    @Field(type = FieldType.Integer)
    private int originalDelay;

    @Field(type = FieldType.Long)
    private Long version = 0L;
    @Field(type = FieldType.Integer)
    private int createTime;
    @Field(type = FieldType.Integer)
    private int updateTime;

    // 0普通发送 1微信助手
    private int groupSendType;

    private List<GroupSendUserInfo> groupSendUserInfos;

    public Long getParentJobId() {
        return parentJobId;
    }

    public void setParentJobId(Long parentJobId) {
        this.parentJobId = parentJobId;
    }

    public Long getChildJobId() {
        return childJobId;
    }

    public void setChildJobId(Long childJobId) {
        this.childJobId = childJobId;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Long getMerId() {
        return merId;
    }

    public void setMerId(Long merId) {
        this.merId = merId;
    }

    public Long getDeviceUniqueId() {
        return deviceUniqueId;
    }

    public void setDeviceUniqueId(Long deviceUniqueId) {
        this.deviceUniqueId = deviceUniqueId;
    }

    public Integer getDeviceType() {
        return deviceType;
    }

    public void setDeviceType(Integer deviceType) {
        this.deviceType = deviceType;
    }

    public Integer getMsgType() {
        return msgType;
    }

    public void setMsgType(Integer msgType) {
        this.msgType = msgType;
    }

    public String getBizUserId() {
        return bizUserId;
    }

    public void setBizUserId(String bizUserId) {
        this.bizUserId = bizUserId;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public int getDelay() {
        return delay;
    }

    public void setDelay(int delay) {
        this.delay = delay;
    }

    public int getRetry() {
        return retry;
    }

    public void setRetry(int retry) {
        this.retry = retry;
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public int getOriginalDelay() {
        return originalDelay;
    }

    public void setOriginalDelay(int originalDelay) {
        this.originalDelay = originalDelay;
    }

    public String getDeviceId() {
        return deviceId;
    }

    public void setDeviceId(String deviceId) {
        this.deviceId = deviceId;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public Long getVersion() {
        return version;
    }

    public void setVersion(Long version) {
        this.version = version;
    }

    public int getCreateTime() {
        return createTime;
    }

    public void setCreateTime(int createTime) {
        this.createTime = createTime;
    }

    public int getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(int updateTime) {
        this.updateTime = updateTime;
    }

    public int getGroupSendType() {
        return groupSendType;
    }

    public void setGroupSendType(int groupSendType) {
        this.groupSendType = groupSendType;
    }

    public List<GroupSendUserInfo> getGroupSendUserInfos() {
        return groupSendUserInfos;
    }

    public void setGroupSendUserInfos(List<GroupSendUserInfo> groupSendUserInfos) {
        this.groupSendUserInfos = groupSendUserInfos;
    }

    public static class GroupSendUserInfo {
        private Long userId;
        private String bizUserId;
        private String nickName;

        public Long getUserId() {
            return userId;
        }

        public void setUserId(Long userId) {
            this.userId = userId;
        }

        public String getBizUserId() {
            return bizUserId;
        }

        public void setBizUserId(String bizUserId) {
            this.bizUserId = bizUserId;
        }

        public String getNickName() {
            return nickName;
        }

        public void setNickName(String nickName) {
            this.nickName = nickName;
        }
    }

}
